<template>
<div class="messageSingle flex flex-between" @click="goMessageDetail()">
  <img :src="message.avatar">
  <div class="center">
    <div class="flex flex-between">
      <p class="name">{{message.name}}</p>
      <p class="time marginAuto0">{{message.time}}</p>
    </div>
    <p class="content">{{message.content}}</p>
  </div>

</div>
</template>

<script>
export default {
  name: "messageSingle",
  props:{
    message:{
      type:Object,
      default(){
        return{
          id:""
        }
      }
    }
  },
  methods:{
    goMessageDetail(){
      this.$router.push("/messageDetail?id="+this.message.id)
    }
  }
}
</script>

<style lang="less" scoped>
.messageSingle{
  padding: .3rem .4rem;
  img{
    width: 1.5rem;
    height: 1.5rem;
    margin-right: .4rem;
    border-radius: 50%;
  }
  .center{
    width: 8rem;
    .name{
      color: #76382D;
      font-size: .6rem;
    }
    .time{
      font-size: .45rem;
      color: #999999;
    }
    .content{
      width: 7rem;
      font-size: .45rem;
      color: #999999;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

}
</style>